<!-- 
    效果实现了，但由于multi-column布局中子元素的排列顺序是【先从上往下再从左至右】，
    所以这种方式仅适用于数据固定不变的情况，对于滚动加载更多等可动态添加数据的情况就并不适用了。
 -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>multi-column实现瀑布流</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .container {
            column-count: 3;
            column-gap: 10px;
        }
        .container .item {
            border:1px solid #999;
            margin-bottom: 10px;
            height: auto;
            /* 表示元素不能中断 */
            break-inside:avoid;
            /* break-inside:auto; */
        }
        .container .item img{
            width: 100%;
        }

    </style>
</head>
<body>
   <div class="container">
       <div class="item">
           <img src="./img/img1.jpg" alt="">
           <!-- <span>美图1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</span> -->
           <span>美图1鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅饿鹅鹅鹅鹅鹅鹅饿鹅鹅鹅鹅鹅鹅饿鹅鹅鹅鹅鹅鹅饿鹅鹅鹅鹅鹅鹅饿</span>
       </div>
       <div class="item">
        <img src="./img/img2.jpg" alt="">
        <!-- <span>美图2bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb</span> -->
        <span>美图2哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥哥</span>
    </div>
    <div class="item">
        <img src="./img/img3.jpg" alt="">
        <!-- <span>美图3cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc</span> -->
        <span>美图3摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸摸</span>
    </div>
    <div class="item">
        <img src="./img/img4.jpg" alt="">
        <!-- <span>美图4ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd</span> -->
        <span>美图4咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋咋</span>
    </div>
    <div class="item">
        <img src="./img/img5.jpg" alt="">
        <!-- <span>美图5eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee</span> -->
        <span>美图5滋滋滋滋滋滋滋滋滋滋滋滋滋滋滋滋滋滋滋</span>
    </div>
       
   </div>
    <!-- <script src="./waterfall.js"></script> -->
</body>
</html>